<!doctype html>
<html ng-app>
<head>
    <script src="../angular.min.js" type="text/javascript"></script>
</head>
<body>
    <div ng-controller="StudentListController">
        <ul>
            <li ng-repeat="student in students">
                <span>学生姓名：{{student.name}}</span>,<em>编号：{{student.id}}</em>
            </li>
        </ul>
        <button ng-click="insertTom()">Insert</button>
    </div>
    <br/>
    <script type="text/javascript">
        var students = [
            {name:'mary contrary',id:'1'},
            {name:'jack sprat',id:'2'},
            {name:'jill hill',id:'3'}
        ]

        function StudentListController($scope){

            $scope.students = students;
            $scope.insertTom = function(){
                $scope.students.splice(1,0,{name:"Tom",id:4})
            }
        }
    </script>
</body>
</html>